package ch.pizzapp.kurier.data;

import java.util.ArrayList;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public class GenarateItem implements Parcelable {

	@JsonProperty("itemID")
	String itemID;
	@JsonProperty("title")
	String title;
	@JsonProperty("icon")
	String icon;
	@JsonProperty("categorytype")
	String categorytype;
	@JsonProperty("desc")
	String desc;
	@JsonProperty("price")
	String price;

	@JsonProperty("saleprice")
	String saleprice;

	@JsonProperty("sizes")
	List<Size> sizes;

	//String refID;

	Integer quentity = 1;

	Integer selectedSizeIndex = 0;

//	public String getRefID() {
//		return refID;
//	}
//
//	public void setRefID(String refID) {
//		this.refID = refID;
//	}

	public Integer getSelectedSizeIndex() {
		return selectedSizeIndex;
	}

	public void setSelectedSizeIndex(Integer selectedSizeIndex) {
		this.selectedSizeIndex = selectedSizeIndex;
	}

	Double calculatedValue = 0.0;

	public String getItemID() {
		return this.itemID;
	}

	public void setItemID(String itemID) {
		this.itemID = itemID;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getIcon() {
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getCategorytype() {
		return this.categorytype;
	}

	public void setCategorytype(String categorytype) {
		this.categorytype = categorytype;
	}

	public String getDesc() {
		return this.desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getPrice() {
		return this.price;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public String getSaleprice() {
		return this.saleprice;
	}

	public void setSaleprice(String saleprice) {
		this.saleprice = saleprice;
	}

	public List<Size> getSizes() {
		return this.sizes;
	}

	public void setSizes(List<Size> sizes) {
		this.sizes = sizes;
	}

	public Integer getQuentity() {
		return this.quentity;
	}

	public void setQuentity(Integer quentity) {
		this.quentity = quentity;
	}

	public Double getCalculatedValue() {
		return this.calculatedValue;
	}

	public void setCalculatedValue(Double calculatedValue) {
		this.calculatedValue = calculatedValue;
	}

	protected GenarateItem(Parcel in) {
		itemID = in.readString();
		title = in.readString();
		icon = in.readString();
		categorytype = in.readString();
		desc = in.readString();
		price = in.readString();
		saleprice = in.readString();
		sizes = new ArrayList<Size>();
		in.readList(sizes, Size.class.getClassLoader());
		quentity = in.readInt();
		calculatedValue = in.readDouble();
	}

	public GenarateItem() {
	}

	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(itemID);
		dest.writeString(title);
		dest.writeString(icon);
		dest.writeString(categorytype);
		dest.writeString(desc);
		dest.writeString(price);
		dest.writeString(saleprice);
		dest.writeList(sizes);
		dest.writeInt(quentity);
		dest.writeDouble(calculatedValue);
	}

	public static final Parcelable.Creator<GenarateItem> CREATOR = new Parcelable.Creator<GenarateItem>() {
		public GenarateItem createFromParcel(Parcel in) {
			return new GenarateItem(in);
		}

		public GenarateItem[] newArray(int size) {
			return new GenarateItem[size];
		}
	};
}